//
//  TWMineHeaderView.swift
//  EyepetizerImitative
//
//  Created by 田伟 on 2017/3/27.
//  Copyright © 2017年 个人. All rights reserved.
//

import UIKit

protocol TWMineHeaderViewDelegate : NSObjectProtocol {
    func MineHeaderViewMoreButtonDidClick()
    func MineHeaderViewCollectButtonDidClick()
    func MineHeaderViewCommentButtonDidClick()
    func MineHeaderViewLoginIconButtonDidClick()
}

class TWMineHeaderView: UIView {
    // 单击更多按钮
    @IBAction func moreButtonClick() {
        mineHeaderViewDelegate?.MineHeaderViewMoreButtonDidClick()
    }
    // 单击收藏按钮
    @IBAction func collectButtonClick() {
        mineHeaderViewDelegate?.MineHeaderViewCollectButtonDidClick()
    }
    // 单击评论按钮
    @IBAction func commentButtonClick() {
        mineHeaderViewDelegate?.MineHeaderViewCommentButtonDidClick()
    }
    // 登录
    @IBAction func loginButtonClick() {
        loginIconButtonClick()
    }
    // 登录
    @IBAction func loginIconButtonClick() {
        mineHeaderViewDelegate?.MineHeaderViewLoginIconButtonDidClick()
    }
    @IBOutlet weak var bgImageView: UIImageView!
    @IBOutlet weak var iconButton: UIButton!
    
    var mineHeaderViewDelegate : TWMineHeaderViewDelegate?
    
    class func createMineHeaderView() -> TWMineHeaderView {
        return Bundle.main.loadNibNamed("TWMineHeaderView", owner: nil, options: nil)!.first as! TWMineHeaderView
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // 添加边框
        bgImageView.layer.borderWidth = 0.5
        bgImageView.layer.borderColor = UIColor.init(red: 204/256, green: 204/256, blue: 204/256, alpha: 1).cgColor
        
    }
}
